Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-negative-zero

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-negative-zero

Is this value negative zero? === will lie to you

  • 2.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is is-negative-zero?

The is-negative-zero npm package is a utility that provides a simple function to check if a given number is -0. In JavaScript, -0 and +0 are considered distinct values (due to IEEE 754 floating point), and this package helps in identifying if a number is specifically -0.

What are is-negative-zero's main functionalities?

Check if a number is -0

This feature allows you to check if a given number is exactly -0. It returns true if the number is -0, and false otherwise. This can be particularly useful in mathematical computations and graphics programming where the distinction between -0 and +0 can have implications.

const isNegativeZero = require('is-negative-zero');

console.log(isNegativeZero(-0)); // true
console.log(isNegativeZero(0)); // false
console.log(isNegativeZero(-1)); // false

Other packages similar to is-negative-zero

Keywords

FAQs

Package last updated on 19 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc